package com.itheima.web.task;

import com.itheima.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class LogTask {

    @Reference
    private AnalysisByDayService analysisByDayService;

    /**
     * 任务执行 往日志分析表中添加数据
     */
    @Scheduled(cron = "0 0 0/1 * *  ?")//todo 后续功能没有问题   改时间
    public void addAnalysis() {
        System.out.println("日志开始分析了");
        analysisByDayService.saveOrUpdate();
    }
}
